An Optimal Algorithm for Prufer Codes

نویسندگان

  • Xiaodong Wang
  • Lei Wang
  • Yingjie Wu
چکیده

This paper studies the algorithms for coding and decoding Prufer codes of a labeled tree. The algorithms for coding and decoding Prufer codes of a labeled tree in the literatures require time usually. Although there exist linear time algorithms for Prufer-like codes [1,2,3], the algorithms utilize the integer sorting algorithms. The special range of the integers to be sorted is utilized to obtain a linear time integer sorting algorithm. The Prufer code problem is reduced to integer sorting. In this paper we consider the Prufer code problem in a different angle and a more direct manner. We start from a naïve algorithm, then improved it gradually and finally we obtain a very practical linear time algorithm. The techniques we used in this paper are of interest in their own right. ( O nlogn)

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Minimal Edge-ordered Spanning Trees Using a Self-adapting Genetic Algorithm with Multiple Genomic Representations

We consider the problem of finding minimal edge-ordered spanning trees where the edge costs are not fixed, but are time dependent[7]. We propose using multiple genomic redundant representations in a selfadapting genetic algorithm (GA) employing various codes with different locality properties. These encoding schemes (e.g., permutation codes and prufer-like codes) either insure feasibility or re...

متن کامل

Genetic Algorithm for Dynamic Capacitated Minimum Spanning Tree

Many of the network topology design problems include CMST, which means to find a minimum cost tree that connects all the nodes of the network to the central node with some capacity constraint. The links of edges have associated costs that could be based on their distance, capacity, quality of line etc, and the nodes have their associated demand. Usually most of the network obtained from CMST ar...

متن کامل

Optimal Linear Codes Over GF(7) and GF(11) with Dimension 3

Let $n_q(k,d)$ denote the smallest value of $n$ for which there exists a linear $[n,k,d]$-code over the Galois field $GF(q)$. An $[n,k,d]$-code whose length is equal to $n_q(k,d)$ is called {em optimal}. In this paper we present some matrix generators for the family of optimal $[n,3,d]$ codes over $GF(7)$ and $GF(11)$. Most of our given codes in $GF(7)$ are non-isomorphic with the codes pre...

متن کامل

An Application of the Stochastic Optimal Control Algorithm (OPTCON) to the Public Sector Economy of Iran

In this paper we first describe the stochastic optimal control algorithm called ((OPTCON)). The algorithm minimizes an intertemporal objective loss function subject to a nonlinear dynamic system in order to achieve optimal value of control (or instrument) variables. Second as an application, we implemented the algorithm by the statistical programming system ((GAUSS)) to determine the optimal fi...

متن کامل

OPTIMAL WIND RESISTANT DESIGN OF TALL BUILDINGS UTILIZING MINE BLAST ALGORITHM

Practical design of tall frame-tube and diagrids are formulated as two discrete optimization problems searching for minimal weight undercodified constraints under gravitational and wind loading due to Iranian codes of practice for steel structures (Part 6 & Part 10). Particular encoding of design vector is proposed to efficiently handle both problems leading to minimal search space. Two types o...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • JSEA

دوره 2  شماره 

صفحات  -

تاریخ انتشار 2009